<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	window.onload=function(){
		var ctx = document.getElementById('canvas').getContext('2d');
		var gra = ctx.createRadialGradient(400, 300, 50, 500, 300, 300); //(x,y,반지름,x,y,반지름)
		gra.addColorStop(0, '#ff0000');
		gra.addColorStop(0.5, '#ffff00');
		gra.addColorStop(1, '#0000ff');
		
		ctx.fillStyle=gra;
		ctx.fillRect(200, 150, 600, 600);
	}
</script>
</head>
<body>
<canvas width="800" height="800" id="canvas"></canvas>
</body>
</html>